#!/usr/bin/php
<?php

define("DOCXML","./build/doc/jsdoc.xml");
define("DOCXSLT","./lib/js_ScriptDoc_Transform.xslt");
define("OUTPUT","./build/doc/scriptdoc.xml");

$xml = new DOMDocument();
$xml->load(DOCXML);

$xsl = new DOMDocument();
$xsl->load(DOCXSLT);

$p = new XSLTProcessor();
$p->importStylesheet($xsl);
$res = $p->transformToXML($xml);

//$out = simplexml_load_string($res);
//$out->javascript->classes->addChild('class'

$out = new DOMDocument();
$out->loadXML($res);

//$js = $out->documentElement;
//$class = $out->createElement('class');

$out->normalizeDocument();
$out->formatOutput = true;
$out->save(OUTPUT);
?>